<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="mm">hello world</div>
    <div class="dd">hello </div>

    <script>
        let em1=document.querySelector('#mm');  //id
        // console.log(em1);
        alert(em1);
        let em2=document.querySelector('.dd');  //类
        // console.log(em2);
        alert(em2)
        let em3=document.querySelectorAll('div'); 
    </script>
</body>
</html>